<template>
  <div id="changedialog">
    <commonformdialog
      :isshowDialogs="isshowDialog"
      :dialogTitle="dialogTitle"
      @closetextDialog="closetextDialog"
      @confirmbtn="confirmbtn"
      @rejected="rejected"
      :isshowFooter="false"
      :isshowFooterBh="isshowFooterBh"
    >
      <div class="innerLoding">
        <el-row>
          <el-form
            :model="formData"
            ref="ruleForm"
            label-width="120px"
            size="small"
          >
            <el-col :span="24">
              <h3 class="titleTips">基础信息</h3>
            </el-col>
            <el-col :span="12">
              <el-form-item label="微信名:" prop="nickname">
                <span>{{ formData.nickname }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="微信头像:" prop="head_img">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="formData.head_img"
                  :preview-src-list="[formData.head_img]"
                  :zIndex="9999"
                >
                </el-image>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="姓名:" prop="name">
                <span>{{ formData.name }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="身份信息:" prop="id_card">
                <span>{{ formData.id_card }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="生日:" prop="birth">
                <span>{{ formData.birth }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="性别:" prop="sex">
                <span>{{ formData.sex }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="电话号:" prop="phone">
                <span>{{ formData.phone }}</span>
              </el-form-item>
            </el-col>
            <!-- <el-col :span="12">
              <el-form-item label="地址:" prop="address">
                <span>{{ formData.address }}</span>
              </el-form-item>
            </el-col> -->
            <el-col :span="24">
              <div class="line"></div>
            </el-col>
            <el-col :span="24">
              <h3 class="titleTips">身份认证信息</h3>
            </el-col>
            <el-col :span="12">
              <el-form-item label="身份证有效期:" prop="untStartDate">
                <span>{{ formData.untStartDate }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="身份证地址:" prop="untAddress">
                <span>{{ formData.cctAddress }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="身份证正面:" prop="untFrontUrl">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="formData.untFrontUrl"
                  :preview-src-list="[formData.untFrontUrl]"
                  :zIndex="9999"
                >
                </el-image>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="身份证反面:" prop="untEctypeUrl">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="formData.untEctypeUrl"
                  :preview-src-list="[formData.untEctypeUrl]"
                  :zIndex="9999"
                >
                </el-image>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="认证状态:" prop="untStatusText">
                <span>{{ formData.untStatusText }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="审核人:" prop="untApprovalUser">
                <span>{{ formData.untApprovalUser }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12" v-if="formData.untStatus != 9">
              <el-form-item label="">
                <el-button
                  size="small"
                  @click="rejected('name', formData.untId)"
                  >驳回</el-button
                >
                <el-button
                  type="primary"
                  size="small"
                  @click="confirmbtn('name', formData.untId)"
                  >通过</el-button
                >
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <div class="line"></div>
            </el-col>
            <el-col :span="24">
              <h3 class="titleTips">行驶证认证信息</h3>
            </el-col>
            <el-col :span="12">
              <el-form-item label="发证日期:" prop="cltStartDate">
                <span>{{ formData.cltStartDate }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="注册日期:" prop="cltEndDate">
                <span>{{ formData.cltEndDate }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="行驶证正面:" prop="cltFrontUrl">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="formData.cltFrontUrl"
                  :preview-src-list="[formData.cltFrontUrl]"
                  :zIndex="9999"
                >
                </el-image>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="行驶证反面:" prop="cltEctypeUrl">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="formData.cltEctypeUrl"
                  :preview-src-list="[formData.cltEctypeUrl]"
                  :zIndex="9999"
                >
                </el-image>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="认证状态:" prop="cltStatusText">
                <span>{{ formData.cltStatusText }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="审核人:" prop="cltApprovalUser">
                <span>{{ formData.cltApprovalUser }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12" v-if="formData.cltStatus != 9">
              <el-form-item label="">
                <el-button
                  size="small"
                  @click="rejected('license', formData.cltId)"
                  >驳回</el-button
                >
                <el-button
                  type="primary"
                  size="small"
                  @click="confirmbtn('license', formData.cltId)"
                  >通过</el-button
                >
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <div class="line"></div>
            </el-col>
            <el-col :span="24">
              <h3 class="titleTips">车辆信息</h3>
            </el-col>
            <el-col :span="12">
              <el-form-item label="注册日期:" prop="cctRegisterDate">
                <span>{{ formData.cctRegisterDate }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="发证日期:" prop="cctIssueDate">
                <span>{{ formData.cctIssueDate }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="车辆型号:" prop="cctModel">
                <span>{{ formData.cctModel }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="车辆类型:" prop="cctCarType">
                <span>{{ formData.cctCarType }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="车牌号:" prop="cctCarLicense">
                <span>{{ formData.cctCarLicense }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="车辆登记地址:" prop="cctAddress">
                <span>{{ formData.cctAddress }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="使用性质:" prop="cctUseCharacter">
                <span>{{ formData.cctUseCharacter }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="车辆拍照:" prop="cctCarManUrl">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="formData.cctCarManUrl"
                  :preview-src-list="[formData.cctCarManUrl]"
                  :zIndex="9999"
                >
                </el-image>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="认证状态:" prop="cctStatusText">
                <span>{{ formData.cctStatusText }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="审核人:" prop="cctApprovalUser">
                <span>{{ formData.cctApprovalUser }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12" v-if="formData.cctStatus != 9">
              <el-form-item label="">
                <el-button size="small" @click="rejected('car', formData.cctId)"
                  >驳回</el-button
                >
                <el-button
                  type="primary"
                  size="small"
                  @click="confirmbtn('car', formData.cctId)"
                  >通过</el-button
                >
              </el-form-item>
            </el-col>
          </el-form>
        </el-row>
      </div>
      <toExamine
        :isshowDialogE="isshowDialogE"
        :dialogdataE="dialogdataE"
        @closedialogE="closeDialogE"
        @confirmbtnE="confirmbtnE"
      ></toExamine>
    </commonformdialog>
  </div>
</template>

<script type="text/javascript">
//引入弹窗
import commonformdialog from "@/components/commondialog/commondialog";
import toExamine from "./toExamine";

export default {
  data() {
    return {
      formData: {},
      isshowFooterBh: false,
      isshowDialogE: false,
      dialogdataE: {},
    };
  },
  props: {
    //是否显示弹窗
    isshowDialog: {
      type: Boolean,
      default: false,
      required: true,
    },
    //表单的名字
    dialogTitle: {
      type: String,
      default: "",
      required: true,
    },
    //是编辑还是新增
    formType: {
      type: Number,
      default: 0,
    },
    dialogdata: {
      type: Object,
    },
  },
  components: {
    commonformdialog,
    toExamine,
  },
  methods: {
    closetextDialog() {
      this.$emit("closedialog");
    },
    //关闭审核弹框
    closeDialogE() {
      this.isshowDialogE = false;
    },
    //提交审核
    confirmbtnE() {
      this.isshowDialogE = false;
      //通知父级关闭弹框
      console.log("审核提交");
      this.$emit("confirm");
    },
    //驳回
    rejected(type, cid) {
      this.status = 2;
      this.id = cid;
      this.type = type;
      let params = {};
      params.id = cid;
      params.type = type;
      params.status = 2;
      this.dialogdataE = params;
      this.isshowDialogE = true;
    },
    //通过
    confirmbtn(type, cid) {
      this.status = 1;
      this.id = cid;
      this.type = type;
      let params = {};
      params.id = cid;
      params.type = type;
      params.status = 1;
      this.dialogdataE = params;
      this.isshowDialogE = true;
    },
  },
  watch: {
    dialogdata: function (val) {
      if (val) {
        this.formData = val;
      }
    },
    formType: function (val) {
      if (val === 0) {
        this.isshowFooterBh = false;
      } else {
        this.isshowFooterBh = true;
      }
    },
  },
  created() {},
};
</script>

<style lang="scss" scoped>
</style>
